package cn.rkylin.oms.aftersale.resend.vo;

import cn.rkylin.oms.aftersale.resend.domain.AfterSaleResend;

/**
 * 类名:AfterSaleReissueListVO <br/>
 * 作用: 补发单数据对象. <br/>
 * 创建原因: 补发单数据对象. <br/>
 * 创建时间: 2017年10月13日 上午10:06:46 <br/>
 * 
 * @author suqiaohui
 * @version v1.0
 */
public class AfterSaleResendVO extends AfterSaleResend {

    /**
     * 
     */
    private static final long serialVersionUID = -5280096482281013728L;
    private static final String STATUS_ECORDERSHOW = "<span class=\"fa fa-chevron-down\" resendId=\"%s\"></span>"; // 明细显示箭头
    private static final String OUTDATETIMESHOW = "<span class='badge badge-red'> </span>"; // 超时标识
    private static final String EXCEPTION_FLAG = "<span class='badge badge-red'> </span>"; // 异常标识
    private static final String OUTDAY = "3";
    // 前台需要绑定status才能显示中文的状态
    private String status; // 状态

    /**
     * 排序
     */
    private String orderBy;

    /**
     * 快速查询
     */
    private String searchCondition;

    public String getStatus() {
        if ("a".equals(this.getResendStatus())) {
            return "待审核";
        } else if ("b".equals(this.getResendStatus())) {
            return "待发货";
        } else if ("c".equals(this.getResendStatus())) {
            return "已完成";
        } else if ("d".equals(this.getResendStatus())) {
            return "已取消";
        }
        return " ";
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getSearchCondition() {
        return searchCondition;
    }

    public void setSearchCondition(String quickSearch) {
        // TODO Auto-generated method stub
        this.searchCondition = quickSearch;
    }

    public String getOrderBy() {
        // 此字段需要防止sql注入
        return orderBy == null ? null : orderBy.replaceAll(".*([';]+|(--)+).*", " ");
    }

    public void setOrderBy(String orderBy) {
        this.orderBy = orderBy;
    }

}
